Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

210
Visualizações
var max = setTimeout(";"); can clear all setTimeout events ,but i'm can understand the code
var max = setTimeout(";");
for (var i=1; i< max; i++) clearTimeout(i);

I'm found the code in stack overflow can to clear all setTimeout events,

but how to understand var max = setTimeout(";");? What mean is it?

Here is original question => How to stop all timeouts and intervals using javascript?

Thank you!

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

setTimeout returns a numeric ID which can be used to clear the timeout.

Creating a new timeout creates a new ID.

This code assumes that IDs will always be issued in sequential order (although I'm not aware of any implementation which doesn't).

about 4 years ago · Juan Pablo Isaza Relatório

0

It simply creates empty timeout. And since setTimeout returns it's reference as incremented value, that way you can tell how much timeouts there is on page

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda